<template>
    <div class="subpage">
        <div class="banner"></div>
         <div class="title">
            <h2>课程学习</h2>
            <el-divider><i class="el-icon-guide titleicon"></i></el-divider>
            <h3>以学员满意度、以学员学习效果为本</h3>
        </div>
        <div class="demoList">
        <ul class="clearfix" id="box">
                <router-link to="/subjectLearn/1" tag="li" class="typeitem" v-show="show2" @click="handleTpe(index+1)">
                    <img src="/static/image/ts1.png" class="image"><p class="teacher">预习模式</p>
                </router-link >
                <router-link to="/subjectLearn/3" tag="li" class="typeitem " v-show="show2"  @click="handleTpe(index+1)">
                    <img src="/static/image/ts2.png" class="image"><p class="teacher">复习模式</p>
                </router-link>
                <router-link to="/subjectLearn/2" tag="li" class="typeitem" v-show="show2"  @click="handleTpe(index+1)">
                    <img src="/static/image/ts3.png" class="image"><p class="teacher">专题模式</p>
                </router-link >
                <router-link to="/subjectLearn/4" tag="li" class="typeitem" v-show="show2"  @click="handleTpe(index+1)">
                    <img src="/static/image/ts4.png" class="image"><p class="teacher">题库模式</p>
                </router-link >
        </ul>
      </div>
        
    </div>
</template>

<script>
    export default{
        data(){
            return{
                show2: false
            }
        },
        mounted(){
            this.show2 = !this.show2
        },
        methods:{
            handleTpe(type){
                localStorage.setItem('type',type);
            }
        }
    }

</script>

<style lang='scss' scoped>
.subpage{
    .banner{
        width: 100%;
        height: 360px;
        background: url('/static/image/bannerpic.png') no-repeat;
        background-size:100% 100%;
        background-position: center; 
    }
    .title{
        width: 1100px;
        margin:  0 auto;
        h2 {
            font-size: 36px;
            text-align: center;
            margin: 40px 0;
            font-weight: normal;
        }
        h3 {
            font-size: 18px;
            text-align: center;
            color: #737373;
            margin: 40px 0;
            font-weight: normal;
        }
        .el-divider__text, .el-link {
            font-weight: 500;
            font-size: 45px;
        }
    }
}

  .demoList ul {
    margin-bottom: 100px;
    padding: 0 20px
  }
  .demoList{
    padding-top: 30px;
     width: 1100px;
    margin:  0 auto;
  }
  .demoList li {
    color: #737373;
    width: 400px;
    min-height: 260px;
    float: left;
    margin-right: 250px;
    margin-bottom: 60px;
    border-left: 1px solid #eaeceb;
    border-right: 1px solid #eaeceb;
    box-shadow: 0 2px 3px #b2b2b2;
    text-align: center;
    cursor: pointer;
    &:nth-child(even){margin-right: 0;}
  }
  .teacherinfo{
    text-overflow: -o-ellipsis-lastline;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .demoList li:last-child {
    margin-right: -50px;
  }
  .demoList li .teacher {
    height: 60px;
    line-height: 60px;
    font-size: 16px;
    text-align: center;
  }
  .typeitem{
    cursor: pointer;
    &:first-child{
      position:relative;
      animation:mymove1 2s infinite;
      animation-iteration-count:1;
    }
    &:nth-child(2){
      position:relative;
      animation:mymove2 2s infinite;
      animation-iteration-count:1;

    }
    &:nth-child(3){
      position:relative;
      animation:mymove3 2s infinite;
      animation-iteration-count:1;

    }
    &:nth-child(4){
      position:relative;
      animation:mymove4 2s infinite;
      animation-iteration-count:1;

    }
  }
  .demoList li .pic {
    position: relative;
    height: 200px;
    width: 260px;
    border-bottom: 2px solid #CA0000;
    margin-bottom: 15px;
  }
   .demoList li .iconedit{
     position: absolute;
     left: 120px;
     bottom: -25px;
     width: 50px;
     height: 50px;
     line-height: 50px;
     border-radius: 100%;
     border: 2px solid #fff;
     text-align: center;
     background-color: #CA0000;
     color: #fff;
     font-size: 24px;
   }
  .demoList li .image {
    height: 199px;
    width: 100%;
    display: block;
  }
  .demoList li .starbox{
    margin: 30px auto;
    width: 230px;
  }
  .demoList li .starbox img{
    width: 100%;
    height: 100%;
  }

  @keyframes mymove1
{
from {left:-1000px;}
to {left:0px;}
}

  @keyframes mymove3
{
from {bottom:-1000px;}
to {bottom:0px;}
0%{opacity: 0;}
95%{opacity: 0.5;}
100%{opacity: 1;}
}

  @keyframes mymove2
{
from {top:-250px;opacity: 0}
to {top:0px;opacity: 1}
0%{opacity: 0;}
95%{opacity: 0.5;}
100%{opacity: 1;}

}

  @keyframes mymove4
{
from {right:-1000px;}
to {right:0px;}
}
</style>